﻿<%<hi:common_header runat="server" skinname="ascx/tags/Skin-Common-Top.ascx" />%> 
<link href="http://res.juseshop.com/templates/master/jusekeji/style/User_Personal.css" rel="stylesheet" />
<script src="http://res.juseshop.com/utility/common.js" type="text/javascript"></script>
<script src="http://res.juseshop.com/utility/validate/pagevalidator.js" type="text/javascript"></script>
<script src="http://res.juseshop.com/utility/submmitorder.helper.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
    function InitValidators() {
        initValid(new InputValidator('SubmmitOrder_txtShipTo', 2, 20, false, '[\u4e00-\u9fa5a-zA-Z]+[\u4e00-\u9fa5_a-zA-Z0-9]*', '名字不能为空，只能是汉字或字母开头，长度在2-20个字符之间'));
        initValid(new InputValidator('SubmmitOrder_txtAddress', 3, 200, false, null, '详细地址不能为空,3-200个字符'));
        initValid(new InputValidator('SubmmitOrder_txtTelPhone', 3, 20, true, null, '收货人的电话号码(区号-电话号码-分机)'));
        initValid(new InputValidator('SubmmitOrder_txtCellPhone', 3, 20, true, null, '收货人的手机号码'));

    }

    $(document).ready(function () {
        javascript: window.history.forward(1);

        InitValidators();
        $("#SubmmitOrder_Common_ShippingModeList___grdShippingMode_ctl02_radioButton").attr("checked", "checked");
        $("#SubmmitOrder_inputShippingModeId").val(2);
        $("#SubmmitOrder_grd_Common_PaymentModeList___lvPayment_ctrl2_radioButton").attr("checked", "checked");
        $("#SubmmitOrder_inputPaymentModeId").val(1);
    });

    function AddShippAddresscs() {
        $.ajax({
            url: "SubmmitOrderHandler.aspx",
            type: 'post', dataType: 'json', timeout: 10000,
            data: {
                Action: "AddShippingAddressNew", ShippingTo: $("#SubmmitOrder_txtShipTo").val(),
                RegionId: $("#regionSelectorValue").val(),
                AddressDetails: $("#SubmmitOrder_txtAddress").val(),
                ZipCode: "410001",//$("#SubmmitOrder_txtZipcode").val(),
                TelPhone: "12345",//TelPhone: $("#ctl00_txtTelPhone").val().replace(/\s/g, ""),
                AnotherAddress: "",//$("#SubmmitOrder_txtAnotherAddress").val(),
                CellHphone: $("#SubmmitOrder_txtCellPhone").val()
            },
            success: function (resultData) {
                if (resultData.Status == "OK") {
                    parent.location.reload();
                    var divlist = "<div class=\"list select\">";
                    divlist += "<div class=\"inner\">";
                    divlist += "<div class=\"addr-hd\">";
                    divlist += resultData.Result.RegionId + "（<span class=\"name\">" + resultData.Result.ShipTo + "</span><span>收）</span>";
                    divlist += "</div>";
                    divlist += "<div class=\"addr-bd\" title=\"" + resultData.Result.ShippingAddress + "\">";
                    divlist += "<span class=\"street\">" + resultData.Result.ShippingAddress + "</span><span class=\"phone\">" + resultData.Result.CellPhone + "</span>";
                    divlist += "<span class=\"last\">&nbsp;</span>";
                    divlist += "</div>";
                    divlist += "</div>";
                    divlist += "<em class=\"curmarker\"></em><input type=\"hidden\" value=\"" + resultData.Result.ShippingId + "\"/>";
                    divlist += "</div>";
                    $(".list").removeClass("select");
                    $(".list:last").after(divlist);
                    $("#user_shippingaddress").hide();
                    ReSetAddress(resultData.Result.ShippingId);

                }
                else {
                    alert(resultData.Result);
                }
            }
        });
    }

</script>
<style type="text/css">
    
</style>
<form runat="server" id="form1">
    <div class="cart_h">
        <div id="logo">
            <a href="/">
                <img src="http://image.juseshop.com/images/index/logoold.png">
            </a>
        </div>

        <div class="cart_step">
            <ul class="cart_step2">
                <li class="step-1"><b></b>1.我的购物车</li>
                <li class="step-2"><b></b>2.填写核对订单信息</li>
                <li class="step-3">3.成功提交订单</li>
            </ul>
        </div>
    </div>
    <div style="width: 1000px; margin: 0 auto;"><%<hi:smallstatusmessage id="Status" runat="server" visible="False" />%></div>
    <div class="cart_content">
        <div class="OrderSubmit">
            <div class="OrderSubmit_switch">
                <h2>请填写并核对订单信息</h2>
                <p>
                    <!-- <a id="a_salemode">切换到代销模式</a>-->
                </p>
            </div>
            <%
            <asp:panel id="pannel_useraddress" runat="server" clientidmode="Static"> %>
            <div class="cart_Order_address">
                <h3 style="border-top:1px solid #ebeaea;">收货地址</h3>
                <div class="address_have" id="addresslist">
                    <% <Hi:Common_ShippingAddress runat="server" /> %>
                    <div class="control">
                        <a class="use_newAddr" id="btnaddaddress">+使用新地址</a>
                    <!--<a class="manageAddr" target="_blank" href="url:user_UserShippingAddresses">管理收货地址</a>-->
                        <a class="manageAddr" target="_blank" href="url:user_ReceivingAddress">管理收货地址</a></div>
                </div>
                <div class="comon_submmitorder_address">
                    <% <Hi:Common_Link_OpenId_Address Text="获取支付宝收货地址" ImageUrl="images/alipay_consignee.png"  runat="server"  />%>
                </div>
            </div>
            
            <%</asp:panel>
            %>
            <div class="comon_submmitorder_address2">
                <input type="hidden" id="hdcopyshipping" value="SubmmitOrder_txtShipTo,SubmmitOrder_txtCellPhone,SubmmitOrder_txtTelPhone,SubmmitOrder_txtZipcode,SubmmitOrder_txtAddress" />
                <%<hi:common_copyshippingaddress runat="server" />%>
            </div>
            <div class="cart_Order_address" id="user_shippingaddress">
                <div class="receive_good_nav clearfix">
                    <h1 id="tr_addresstitle">添加收货地址</h1>
                    <a href="#"><img id="imgCloseLogin" src="http://image.juseshop.com/images\/newindex/receive_good_xx.png"></a>
                </div>
               
                <div class="receive_good_nav_content clearfix">
                    <ul>
                        <li>
                            <span class="stitle">收货人：</span><%<asp:textbox id="txtShipTo" runat="server" />%><em id="txtShipToTip" runat="server"></em>
                        </li>
                        <li>
                            <span class="stitle">配送区域：</span><Hi:RegionNewSelector runat="server" id="dropRegions" />
                        </li>
                        <li><span class="stitle">详细地址：</span><%<asp:textbox id="txtAddress" width="487" runat="server" />%><em id="txtAddressTip" runat="server"></em></li>
                        
                        <li>
                            <span class="stitle">手机号码：</span><%<asp:textbox id="txtCellPhone" runat="server" />
                            %><em id="txtCellPhoneTip"
                                  runat="server"></em>
                        </li>
                        <!--<li>
                            <span class="stitle">邮编：</span><%<asp:textbox id="txtZipcode" runat="server" />
                            %><em class="sonic" style="display:inline-block;vertical-align:middle;"></em><em class="Zipcode_msg"></em>
                        </li>-->
                        <li>
                            <!--<span class="stitle">地址别名：</span><%<asp:textbox id="txtAnotherAddress" runat="server" />
                            %><em>设置一个易记的名称，如：“送到家里”、“送到公司”</em>-->
                        </li>
                    </ul>
                </div>
                <div id="btnaddr" class="receive_good_nav_contentss clearfix">
                    <p><a class="asave" prefix="wnxd_Ajax" onclick="return AddShippAddresscs()">保  存</a><!--<a class="asave" onclick="return AddShippAddresscs()">保  存</a>--></p>

                </div>

                



            </div>
            <div class="Order_deliver_time">
                <h2>送货上门时间：</h2>
                <select runat="server" id="drpShipToDate" class="textform">
                    <option>时间不限</option>
                    <option>周一至周五</option>
                    <option>周六日及公众假期</option>
                </select>
            </div>
            <div class="cart_Order_deliver">
                <h3>配送方式</h3>
                <%<hi:common_shippingmodelist runat="server" />%>
                <h3>支付方式</h3>
                <span id="PaymentList"><%<hi:common_paymentmodelist runat="server" />%>
                </span>
            </div>
            <div class="cart_Order_info">
                <h3>商品清单<a href="/ShoppingCart.aspx" class="return">返回修改购物车</a></h3>
                <div class="cart_Order_info2">
                    <%<hi:common_submmintorder_productlist runat="server" width="100%" />%>
                   
                    <div class="cart_Weight">
                        <strong>货物总重量：</strong><span style="color: Green; font-weight: 700;"><%<asp:label id="litAllWeight" runat="server" />%></span>
                        克&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;<em>运费：</em><span style="font-family: 'microsoft yahei'; color: #008000">￥<%<hi:formatedmoneylabel id="lblShippModePrice" runat="server" nulltodisplay="0.00" />%>
                            <%<asp:hyperlink id="hlkFeeFreight" runat="server" target="_blank" />%></span>&nbsp;&nbsp;&nbsp;
                    </div>
                </div>
                <div class="cart_Order_info">
                    <%<hi:common_submmintorder_giftlist runat="server" width="100%" />%>
                    
                </div>
                <div class="cart_Order_info3">
                    <div class="cart_Order_coupon3">
                        <div class="cart_Order_coupon" id="divcopue">
                            <table width="640" cellspacing="0" cellpadding="0" runat="server" border="0" id="tbCoupon">
                                <tbody>
                                    <tr>
                                        <td width="240" height="32">
                                            <link href="http://res.juseshop.com/utility/easyui.css" rel="stylesheet" type="text/css" />
                                            <script type="text/javascript" src="http://res.juseshop.com/utility/jquery.easyui.min.js"></script>
                                            <select id="CmbCoupCode" name="CmbCoupCode" class="easyui-combobox" required="false"
                                                style="width: 240px;" runat="server">
                                            </select>
                                        </td>
                                        <td width="10">&nbsp;</td>
                                        <td width="390">
                                            <input type="button" value="使用优惠券" id="btnCoupon" />
                                            <span style="font-size: 12px;">(使用优惠券可抵扣订单金额)</span>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <table width="580" cellspacing="0" cellpadding="0" border="0">
                                <tbody>
                                    <tr>
                                        <td width="190">
                                            <b style="font-size: 14px; color: #cb0100">您需要附加说明吗？</b>
                                        </td>
                                        <td valign="middle" height="15" align="left"><%<asp:textbox id="txtMessage" runat="server" textmode="MultiLine" rows="1" columns="45" />%>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <table width="580" cellspacing="0" cellpadding="0" border="0">
                                <tr>
                                    <td width="180">
                                        <input type="checkbox" runat="server" id="chkTax" name="chkTax" onclick="javascript: if (this.checked) { $('#div_fapiao').show(); } else { $('#div_fapiao').hide() }" />

                                        是否需要发票
                                    </td>
                                    <td align="left">
                                        <div id="div_fapiao" style="display: none">
                                            税金：(<em><%<asp:label runat="server" id="litTaxRate" />%></em>%)
                                            +<span>￥<span><%<hi:formatedmoneylabel id="lblTax" runat="server" nulltodisplay="0.00" />%></span></span>
                                            发票抬头：<%<asp:textbox id="txtInvoiceTitle" runat="server" maxlength="50" cssclass="cart_invoice" width="160px" />%>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <div class="cart_Order_total">

                        <div>
                            <%<asp:literal runat="server" id="litProductAmount" />%>
                        </div>
                        <div>
                            <h2>购物车小计：</h2>
                            <span>￥<%<hi:formatedmoneylabel id="lblTotalPrice" runat="server" />%>&nbsp;<%<asp:literal runat="server" id="litProductBundling" />%></span>
                        </div>


                        <div>
                            <%<asp:hyperlink id="hlkReducedPromotion" runat="server" target="_blank" />%>
                        </div>

                        <div>
                            <h2>可得积分：</h2>
                            <span><%<asp:label id="litPoint" runat="server" />%>
                                <%<asp:hyperlink id="hlkSentTimesPoint" runat="server" target="_blank" />%></span>
                        </div>
                        <div>
                            <h2>优惠券抵扣金额：</h2>
                            <span>￥<%<hi:formatedmoneylabel id="litCouponAmout" runat="server" nulltodisplay="0.00" />%></span>
                        </div>
                        <div id="divPaymentPrice" style="display: none">
                            <h2>支付手续费：</h2>
                            <span>￥<%<hi:formatedmoneylabel id="lblPaymentPrice" runat="server" nulltodisplay="0.00" />%></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="cart_Order_submit2">
                <%<asp:button id="btnCreateOrder" runat="server" text="确认提交" />%><span class="total">应付总额：<span>￥<%<hi:formatedmoneylabel id="lblOrderTotal" runat="server" />%></span>元</span>
            </div>
        </div>
    </div>
    <!--所有的隐藏域-->
    <input runat="server" id="htmlCouponCode" type="hidden" />
    <input runat="server" id="inputPaymentModeId" type="hidden" />
    <input runat="server" id="inputShippingModeId" type="hidden" />
    <input type="hidden" id="hdbuytype" name="hdbuytype" runat="server" />
    <input type="hidden" runat="server" name="moban" id="mobanPic" />
    <!--结束-->
    <script src="http://res.juseshop.com/utility/sonic.js" type="text/javascript"></script>
    <script type="text/javascript">
        var sonic = new Sonic({ "width": 24, "height": 24, "stepsPerFrame": 3, "trailLength": 1, "pointDistance": 0.01, "fps": 30, "step": "fader", "strokeColor": "#cf1381", "path": [["arc", 12, 12, 10, 360, 0]] });
        $(function () {
            $(".sonic").append(sonic.canvas);
            var $zcmsg = $(".Zipcode_msg");
            $(".MessageError").css("display", "none")
            $("table.MessageError").css('margin-left', '866px');
            var pic = $("#SubmmitOrder_lblShippModePrice").text();
            var pics = $("#SubmmitOrder_mobanPic").val(pic);

            var ddlRegions = $("select[selectset=regions]");
            ddlRegions.eq(2).change(function () {
                if (ddlRegions[2].selectedIndex > 0) {
                    $(".sonic").show();
                    sonic.play();
                    $zcmsg.text("正在获取中...");
                    $.post("RegionHandler.aspx", "action=getzcode&province=" + ddlRegions[0].options[ddlRegions[0].selectedIndex].text + "&city=" + ddlRegions[1].options[ddlRegions[1].selectedIndex].text + "&county=" + ddlRegions[2].options[ddlRegions[2].selectedIndex].text, function (e) {
                        $("#SubmmitOrder_txtZipcode").val(e);
                        sonic.stop();
                        $(".sonic").hide();
                        $zcmsg.text("");
                    })
                }
            });
        })
        $("#SubmmitOrder_lblShippModePrice").val();
        $("#SubmmitOrder_mobanPic").val();
     
    
        $(function () {
            $("#SubmmitOrder_btnCreateOrder").checked
        })


    </script>
    <script type="text/ecmascript">

       

        
    
    </script>
</form>
<%<hi:common_footer runat="server" skinname="ascx/tags/Skin-Common_Bottom.ascx" />%>

<script src="http://res.juseshop.com/utility/YB_Zhizi.js" type="text/javascript"></script>
<!--<script>
    $(function () {
        $("#PaymentList").find("ul li:eq(1)").hide();
    });
</script>-->
